
package textmining.gpanalysis.stemming;
import textmining.gpanalysis.AnalyzerUtil;
import textmining.gpanalysis.stemming.PorterStemSnippet;
import textmining.gpanalysis.stemming.SnowballStemSnippet;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
import java.lang.String;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.analysis.Token;
/**
 *
 * @author ibrahimsabek
 */
public class StemmingMain {

    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws FileNotFoundException, IOException, ClassNotFoundException {
        //try {
           
            //test standard analyzer with string
            
            //String tmp = tryhere();

            //System.out.println(tmp);
        System.out.println(Math.log(Double.MAX_VALUE));
            /*
            //test PorterStem Analyzer with file input
            PorterStemSnippet stemSnippet = new PorterStemSnippet();
            stemSnippet.stemm();
            */

            //test SnowballStem Analyzer with file input
          //  SnowballStemSnippet snowballStemSnippet = new SnowballStemSnippet();
            //snowballStemSnippet.stemm();


       // } catch (FileNotFoundException ex) {
         //   System.out.println(ex.getMessage());
        //}

    
    }


    private static String tryhere(){
            Analyzer analyzer = new StandardAnalyzer();
            TokenStream tStream = analyzer.tokenStream("myfield", new StringReader("some text goes here"));

            Token t = new Token();
        try {
             String temp = null;
            while ((t = tStream.next(t)) != null) {
                 temp= t.term();
                System.out.println("token: " + temp);
                //t = tStream.next(t);
                
            }
            return temp;
        } catch (IOException ex) {
            Logger.getLogger(StemmingMain.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
}

